package com.reborn.mall.api.model.vo;

import lombok.Builder;
import lombok.Data;

import java.io.Serializable;

/**
 * 登录信息VO
 *
 * @author wu.yue
 * @since 2020/2/29
 */
@Data
@Builder
public class LoginInfoVO implements Serializable {
    private String message;

    private String token;

    private String tokenHead;

    private Boolean success;

    public static LoginInfoVO failed(String message) {
        return LoginInfoVO
                .builder()
                .success(false)
                .message(message)
                .build();
    }

    public static LoginInfoVO success(String token, String tokenHead) {
        return LoginInfoVO
                .builder()
                .success(true)
                .token(token)
                .tokenHead(tokenHead)
                .build();
    }
}